package org.ajc.gift.Fallback;

import feign.hystrix.FallbackFactory;
import org.ajc.gift.SysClient;
import org.ajc.gift.exception.ResponseCode;
import org.ajc.gift.util.AjaxResult;
import org.springframework.stereotype.Component;

@Component
public class SysClientFallback implements FallbackFactory<SysClient> {

    @Override
    public SysClient create(Throwable throwable) {
        return new SysClient() {
            @Override
            public AjaxResult list() {
                return AjaxResult.me().setSuccess(false).setMessage(ResponseCode.RESPONSE_CODE_500.getMsg());
            }
        };
    }
}
